<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:62:"D:\phpstudy_pro\demo/application/home\view\blogpage\index.html";i:1613535313;}*/ ?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="/public/static/home/css/bootstrap.min.css">
    <link href="/public/static/home/dist/summernote.css" rel="stylesheet"/>

</head>
<body>
<div class="summernote" id="summernote"></div>

</body>
<script src="/public/static/home/js/jquery.min.js"></script>
<script src="/public/static/home/js/bootstrap.min.js"></script>
<script src="/public/static/home/dist/summernote.js"></script>
<script src="/public/static/home/dist/lang/summernote-zh-CN.js"></script>    <!-- 中文-->
<script>
    $(document).ready(function () {
        $('#summernote').summernote({
            lang: 'zh-CN',
            placeholder: '666',
            height: 200,
            callbacks: {
                onImageUpload: function (files, editor, editable) {
                    sendFile(files[0], editor, editable);
                }
            }
        });
    }).on('click', function () {
        console.log($('#summernote').summernote('code'));
    })

    function sendFile(files, editor, editable) {
        var data1 = new FormData();
        data1.append('file', files);
        console.log(data1);
        //
        $.ajax({
            data: data1,
            type: 'POST',
            url: 'upload_image.html',
            dataType: 'json',
            contentType: false,
            processData: false,
            success: function (data) {
                $('#summernote').summernote('insertImage', 'https://cdn.luogu.com.cn/fe/logo.png?0fdd294ff62e331d2f70e1a37ba4ee02', 'img');
            },
            error: function (data) {

            }
        })
    }
</script>
</html>
